
package jtrimet;

import java.util.*;

public class Util 
{
	
	static public Calendar getCalendar(long time)
	{
		Calendar c = Calendar.getInstance();
		c.setTimeInMillis(time);
		
		return c;
	}

	static public String getDateText(Calendar c)
	{
		if (c == null)
		{
			return "";
		}
		else
		{
			return getDateText(c.getTimeInMillis());
		}
	}
	
	static public String getDateText(long time)
	{
		Calendar c = getCalendar(time);
		
		if (c.get(Calendar.YEAR) < 2005)
		{
			return "unknown";
		}
		else
		{
			return c.getTime().toString();
		}
	}

}
